﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;
using GMS.Dinasty.BO;

namespace GMS.Dinasty.Reporting
{
    public partial class specificationsNoDiscountReport : DevExpress.XtraReports.UI.XtraReport
    {
        public specificationsNoDiscountReport(string distributor, string customer, string specificationNumber, string dateSpecification, DataTable data)
        {

            InitializeComponent();
            xrLabel2.Text = specificationNumber;
            xrLabel4.Text = dateSpecification;
            xrLabel9.Text = distributor;
            xrLabel10.Text = customer;
            LoadTable(data, dataSet1.Tables["sourceTable"]);
        }
        private void LoadTable(DataTable sourceTable, DataTable destinationTable)
        {

            foreach (DataRow drw in sourceTable.Rows)
            {
                DataRow dr = destinationTable.NewRow();
                Good good = new Good(drw["caption"].ToString());
                //dr = drw;
                dr["order"] = drw["order"];
                dr["caption"] = good.StringForForPrint();
                dr["units"] = drw["units"];
                dr["quantity"] = drw["quantity"];
                dr["price"] = drw["price"];
                dr["lowprice"] = drw["lowprice"];
                dr["summ"] = drw["summ"];
                //dr["summ1"] = drw["summ1"];
                destinationTable.Rows.Add(dr);
            }
        }
    }
}
